import { ToolServiceApi } from "./_org";
import { AxiosResponse } from "axios";
import { objectToUrlParams } from "@/utils/common";
import service from "@/api";
import type { JxtechPageResult, pictureCardQueryParams, pictureCardDeleteFileParam } from "@whjxtech/jxtech-component";

class FilesServiceApi extends ToolServiceApi {
  /**提供给JxtechUploadPictureCardExt-deleteFile接口 */
  delFiles(bean: pictureCardDeleteFileParam[], params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/delFiles";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
}
export const ExportFilesServiceApi = new FilesServiceApi("/FilesService");

class FilesQueryExtServiceApi extends ToolServiceApi {
  /**提供给JxtechUploadPictureCardExt-loadData接口 */
  pageQueryAll(bean: pictureCardQueryParams, params?: any): Promise<AxiosResponse<JxtechPageResult>> {
    let url = this.baseUrl + "/pageQueryAll";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
}
export const ExportFilesQueryExtServiceApi = new FilesQueryExtServiceApi("/FilesQueryExtService");
